using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Xml;
using System.IO;

namespace IPickImporterUI
{
	public abstract class CustomerLog
	{
		private long _CustomerLogID;
		private long _CustomerDevicesID;
		private long _CatalogID;
		private DateTime _DateCreated;
		private bool _isNew;

		#region Constructors
		
		public CustomerLog()
		{
			_CustomerLogID = 0;
		}
		
		public CustomerLog(long CustomerLogID) : this()
		{
			_CustomerLogID = CustomerLogID;
		}
	
		public CustomerLog(long CustomerLogID, long CustomerDevicesID, long CatalogID, DateTime DateCreated) : this()
		{
			_CustomerLogID = CustomerLogID;
			_CustomerDevicesID = CustomerDevicesID;
			_CatalogID = CatalogID;
			_DateCreated = DateCreated;
		}

		#endregion
		
		#region Properties
		
		public long CustomerLogID
		{
			get	{ return _CustomerLogID; }
			set	{ _CustomerLogID = value; }
		}
		
		public long CustomerDevicesID
		{
			get	{ return _CustomerDevicesID; }
			set	{ _CustomerDevicesID = value; }
		}
		
		public long CatalogID
		{
			get	{ return _CatalogID; }
			set	{ _CatalogID = value; }
		}
		
		public DateTime DateCreated
		{
			get	{ return _DateCreated; }
			set	{ _DateCreated = value; }
		}
		
		public bool IsNew
		{
			get 
			{ 
				_isNew = (_CustomerLogID == 0);
				return _isNew; 
			}
			set { _isNew = value; }
		}
		
		#endregion		

		
		/// <summary>
		/// Utility function that returns a DBNull.Value if requested. The comparison is done inline
		/// in the Insert() and Update() functions.
		/// </summary>
		private object SetNullValue(bool isNullValue, object value)
		{
			if (isNullValue)
				return DBNull.Value;
			else
				return value;
		}
	}
}
